package com.mmy.dao.group;

import javax.transaction.Transactional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.mmy.domain.group.TGroupSell;

/**
 * @vesion 
 * @description 
 * @author liys
 * @date 2021-5-24
 */
public interface TGroupSellRepository extends JpaRepository<TGroupSell, Integer>{
	
	/**
	  * @descr 
	  * @param 
	  * @return 
	  * @throws 
	  * @author liys
	  * @date 2021-6-1
	 */
	@Query(value = "select MAX(iSellID) from tGroupSell ", nativeQuery = true)
	Object getMaxID();
	
	/**
	  * @descr 创建只含id的对象 
	  * @param 
	  * @return 
	  * @throws 
	  * @author liys
	  * @date 2021-6-4
	 */
	@Transactional
	@Modifying
	@Query(value = "INSERT INTO tGroupSell(iSellID, iTeamID, iPlanID, iGuideID, cRandomName, cRandomPassWord, iCarID, iNumber, cResponsible, iOilTimes, fAddOil, cOutKilometre, cInKilometre, fTollFee, fRoadBridge, fPark, fTeamPrice, fOtherPrice, iBorrowing, cPriceRemark, fTotalReceipt, fTotalPay, fTotalSurplus, cGuidRemark, fTotalIncome, fOtherIncome, fTotalCollection, fTotalCost, fCharterCar, fGuidePrice, fTotalPrice, cRemark, cGuideTel, cDriverTel, iStatus, iAdjustmentID, iAccountID, iCashierID, dAdjustmentDate, dAccountDate, dCashierDate, fGroundMoney, fDriverMoney, fChargeBack, iSettlementStatus, cTeamOrder, cReceiptExplain, cDescribe, dCreateDate, iCreatorID, cCreator, dModifyDate, iReviserID, cReviser, cMemo, iSpare1, fSpare2, cSpare3, cSpare4, cSpare5) VALUES (1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)", nativeQuery = true)
	void save(@Param("id")int id);
}
